package org.crystal.tradecraft.model.binance.market.filter;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.crystal.tradecraft.model.binance.enumeration.FilterType;

/**
 * <h3>PRICE_FILTER 价格过滤器</h3>
 * 价格过滤器用于检测order订单中price参数的合法性<p>
 * <p>
 * minPrice 定义了 price/stopPrice 允许的最小值; minPrice == 0 的时候则失效。<p>
 * maxPrice 定义了 price/stopPrice 允许的最大值; maxPrice == 0 的时候则失效。<p>
 * tickSize 定义了 price/stopPrice 的步进间隔; tickSize == 0 的时候则失效。<p>
 * 以上每一项均可为0，为0时代表这一项不再做限制。<p>
 * <p>
 * 逻辑伪代码如下：<p>
 * <ul>
 *     <li>price >= minPrice</li>
 *     <li>price <= maxPrice</li>
 *     <li>price % tickSize == 0</li>
 * </ul>
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PriceFilter extends BinanceFilter {

    public PriceFilter() {
        super(FilterType.PRICE_FILTER);
    }

    private double minPrice;

    private double maxPrice;

    private double tickSize;
}
